#!/bin/sh -e

export GOPATH="$PWD/gopath"

clsed '/^BUILD_FLAGS/s/$/ -v -mod=vendor/' Makefile

make FZF_VERSION="$2" FZF_REVISION="${2##*.}"
make FZF_VERSION="$2" FZF_REVISION="${2##*.}" install

mkdir -p "$1/usr/bin" "$1/usr/share"
cp bin/* "$1/usr/bin/"
cp -r man "$1/usr/share/man"
